package org.fao.pims.service.manage.book;

import java.util.List;

import org.fao.pims.model.Book;
import org.fao.pims.persistence.*;
import org.fao.pims.service.pollneeds.PollinationNeedsException;

public class BookManagerImpl implements BookManager {
	
	
	public List getBookChapters(String scientificName) throws BookException {
		
		List bookChapters = null;
		
		BookDao dao = null;
		
		try {
			
			dao = new BookDaoImpl();
					
			bookChapters = dao.getBookChaptersByCrop(scientificName);			
			
			
			
		}
		catch(DataAccessException dae) {
			
			String message = dae.getMessage();
			throw new BookException();
			
		}
		
		if(bookChapters != null) {
			
			return bookChapters;
			
		}
		else {
		
			throw new BookException();
			
		}
		
		
		
	}
	
	

}
